{% extends 'base.html' %}
{% load static %}

{% block css %}
    <link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
{% endblock %}

{% block title %}
    商品列表
{% endblock %}

{% block body %}
    <div class="navbar_con">
        <div class="navbar clearfix">
            <div class="subnav_con fl">
                <h1>全部商品分类</h1>
                <span></span>
                <ul class="subnav">
                    <li><a href="{% url 'goods:list' 'costume' %}" class="fruit">服装配饰</a></li>
                    <li><a href="{% url 'goods:list' 'electronics' %}" class="seafood">数码科技</a></li>
                    <li><a href="{% url 'goods:list' 'sport' %}" class="meet">运动代步</a></li>
                    <li><a href="{% url 'goods:list' 'stationery' %}" class="egg">书籍文具</a></li>
                    <li><a href="{% url 'goods:list' 'game' %}" class="vegetables">公益服务</a></li>
                    <li><a href="{% url 'goods:list' 'other' %}" class="ice">其他</a></li>
                </ul>
            </div>
            <ul class="navlist fl">
                <li><a href="{% url 'goods:index' %}">首页</a></li>
                <li class="interval">|</li>
                <li><a href="{% url 'goods:list' 'all' %}">淘一淘</a></li>
                <li class="interval">|</li>
				<li><a href="" style="text-decoration:line-through;" onclick="alert('暂未开发完成,敬请期待')">求购商城</a></li>
                <li class="interval">|</li>
                <li><a href="" style="text-decoration:line-through;" onclick="alert('暂未开发完成,敬请期待')">公益活动</a></li>
            </ul>
        </div>
    </div>

    <div class="breadcrumb">
        <a href="#">全部分类</a>
        <span>></span>
        <a href="#">最新物品</a>
    </div>

    <div class="main_wrap clearfix">
        <div class="l_wrap fl clearfix">
            <div class="new_goods">
                <h3>新品推荐</h3>
                <ul>
                    {% for new_good in all_good_s %}
                        <li>

                            <a href="{% url 'goods:detail' %}?good_id={{ new_good.id }}"><img
                                    src="{{ MEDIA_URL }}{{ new_good.goods_pic }}"></a>
                            <h4>
                                <a href="{% url 'goods:detail' %}?good_id={{ new_good.id }}">{{ new_good.goods_name }}</a>
                            </h4>
                            <div class="prize">{{ new_good.goods_price }}</div>
                            <div class="operate">
                                <a href="" class="add_goods"></a>
                            </div>
                        </li>
                    {% endfor %}

                </ul>
            </div>
        </div>

        <div class="r_wrap fr clearfix">
            <div class="sort_bar">

                <a href="?sort=" class="{% if sort == '' %}active{% endif %}">默认</a>
                <a href="?sort=goods_price" class="{% if sort == 'goods_price' %}active{% endif %}">价格</a>
                <!--2019/7/31-->
                <a href="?sort=goods_click" class="{% if sort == 'goods_click' %}active{% endif %}">人气</a>
                <!--2019/7/31-->

            </div>

            <ul class="goods_type_list clearfix">
                {% for good in all_goods.object_list %}
                    <li>
                        <a href="{% url 'goods:detail' %}?good_id={{ good.id }}" target="_blank"><img
                                src="{{ MEDIA_URL }}{{ good.goods_pic }}"></a>
                        <h4><a href="{% url 'goods:detail' %}?good_id={{ good.id }}"
                               target="_blank">{{ good.goods_name }}</a></h4>
                        <div class="operate">
                            <span class="prize">￥{{ good.goods_price }}</span>
                            <span class="unit">原价：{{ good.goods_old_price }}</span>
                            <a href="" class="add_goods"></a>
                        </div>
                    </li>
                {% endfor %}


            </ul>

            <div class="pagenation">
                {% if all_goods.has_previous %}
                    <a href="?{{ all_goods.previous_page_number.querystring }}" class="prev">上一页</a>
                {% endif %}
                {% for page in all_goods.pages %}
                    {% if page %}
                        {% ifequal page all_goods.number %}
                            <a href="?{{ page.querystring }}" class="active">{{ page }}</a>
                        {% else %}
                            <a href="?{{ page.querystring }}" class="page">{{ page }}</a>
                        {% endifequal %}
                    {% else %}
                        <a href="none" class="">...</a>
                    {% endif %}
                {% endfor %}
                {% if all_goods.has_next %}
                    <a href="?{{ all_goods.next_page_number.querystring }}" class="next"> 下一页</a>

                {% endif %}

            </div>
        </div>
    </div>


    <!--右侧悬浮菜单-->
    <div class="guide">
        <div class="guide-wrap">
            <a href="#" class="edit" title="常见问题"><span>常见问题</span></a>
            <a href="#" class="find" title="购物车"><span>购物车</span></a>
            <a href="#" class="report" title="在线咨询"><span>在线咨询</span></a>
            <a href="javascript:window.scrollTo(0,0)" class="top" title="回顶部"><span>回顶部</span></a>
        </div>
    </div>

    {% block js %}
        <script type="text/javascript" src="{% static 'js/slide.js' %}"></script>
        <script type="text/javascript">
            BCSlideshow('focuspic');
            var oFruit = document.getElementById('fruit_more');
            var oShownum = document.getElementById('show_count');

            var hasorder = localStorage.getItem('order_finish');

            if (hasorder) {
                oShownum.innerHTML = '2';
            }

            oFruit.onclick = function () {
                window.location.href = 'list.html';
            }
        </script>

    {% endblock %}

{% endblock %}





